<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //箭头函数中的this指向问题
        //箭头函数没有自己的this
        //   const calc = {
        //       add: () => {
        //           console.log(this); //window
        //       }
        //   }
        //   calc.add();

        const calc = {
            add: function() {
                const adder = () => {
                    console.log(this) // calc
                }
                adder()
            }
        }

        calc.add();
    </script>
</body>

</html>